package com.ruoyi.system.controller;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.PreAuthorize;

import com.ruoyi.system.domain.TbSubway;
import com.ruoyi.system.service.TbSubwayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/housemanager/subway")
@RestController
public class TbSubwayController {

    @Autowired
    private TbSubwayService subwayService;

    @PreAuthorize(hasPermi = "house:housemanager:subway:query")
    @GetMapping("/{id}")
    public AjaxResult selectSubwayByCityId(@PathVariable("id")Integer id){
        List<TbSubway> tbSubways = subwayService.selectSubwayByCityId(id);
        return AjaxResult.success(tbSubways);
    }
}
